import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';

class YToast {
  static show(String msg, BuildContext context,
      {Toast? toastLength,
      double? fontSize,
      int? timeInSecForIos,
      ToastGravity? gravity,
      Color? backgroundColor,
      Color? textColor}) {
    Fluttertoast.showToast(
      msg: msg,
      toastLength: Toast.LENGTH_SHORT,
      fontSize: 16.0,
      gravity: ToastGravity.CENTER,
      backgroundColor: Theme.of(context).primaryColor,
      textColor: Colors.white,
      timeInSecForIosWeb: 1,
    );
  }

  static showBottom(String msg, BuildContext context,
      {Toast? toastLength,
      double? fontSize,
      int? timeInSecForIos,
      ToastGravity? gravity,
      Color? backgroundColor,
      Color? textColor}) {
    Fluttertoast.showToast(
      msg: msg,
      toastLength: Toast.LENGTH_SHORT,
      fontSize: 16.0,
      gravity: ToastGravity.BOTTOM,
      backgroundColor: Theme.of(context).primaryColor,
      textColor: Colors.white,
      timeInSecForIosWeb: 1,
    );
  }
}
